<?php

namespace app\api\controller;

use app\common\controller\Api;
use addons\shopro\model\commission\Agent as AgentModel;
/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        $this->success('请求成功');
    }
    public function deal(){
        $agent_list = AgentModel::where("status","normal")->order("user_id")->select();
        for($i = 0;$i < count($agent_list);$i++){
            $agent = new \addons\shopro\library\commission\Agent($agent_list[$i]['user_id']);
            $agent->runUpgradeAgentPlan();
        }
    }
}
